# 有一个已经排好序的列表，现在输入一个数，要求按照原来的规律将它插入其中
def insert_sort(list_1: list, num: int) -> list:
    for i in range(len(list_1)):
        if num <= list_1[i]:
            list_1.insert(i, num)
            return list_1
        elif num > list_1[len(list_1) - 1]:
            list_1.append(num)
            return list_1
        else:
            continue


if __name__ == "__main__":
    list1 = [1, 2, 3, 4, 5, 7, 8, 9, 10]
    print(insert_sort(list1, 11))
